import { defHttp, jsonHttp } from '@/utils/http/axios';
import {
  chatidParams,
  deptListParams,
  deptUserListParams,
  integralListParams,
  rankingListParams,
} from './model/deptModel';
import { BasicListResult, BasicDataResult } from '../model/baseModel';
import { AxiosProgressEvent } from 'axios';
import { ErrorMessageMode } from '#/axios';
import { saveParams } from '@/api/sys/model/userModel';

enum Api {
  //Login = '/login',
  approvalSettingList = '/hl/sys/approval/approvalSettingList',
  saveApprovalSetting = '/hl/sys/approval/saveApprovalSetting',
  approvalSettingDelete = '/hl/sys/approval/approvalSettingDelete',
  settingLineList = '/hl/sys/approval/settingLineList',
  saveSettingLine = '/hl/sys/approval/saveSettingLine',
  settingLineDelete = '/hl/sys/approval/settingLineDelete',
  settingNodeList = '/hl/sys/approval/settingNodeList',
  saveSettingNode = '/hl/sys/approval/saveSettingNode',
  settingNodeDelete = '/hl/sys/approval/settingNodeDelete',

  ywApprovalSubmit = '/hl/heng/yw/approval/ywApprovalSubmit',
  ywApprovalFileSubmit='/hl/heng/yw/approval/ywApprovalFileSubmit',

  ywApprovalPass = '/hl/heng/yw/approval/ywApprovalPass',
  ywApprovalBack = '/hl/heng/yw/approval/ywApprovalBack',
  ywApprovalCancel = '/hl/heng/yw/approval/ywApprovalCancel',
  ywApprovalCreateView = '/hl/heng/yw/approval/ywApprovalCreateView',
  ywApprovalLogView = '/hl/heng/yw/approval/ywApprovalLogView',
  ywApprovalList = '/hl/heng/yw/approval/ywApprovalList',
  ywApprovalShow = '/hl/heng/yw/approval/ywApprovalShow',
  ywApprovalRemove = '/hl/heng/yw/approval/ywApprovalRemove',

  countApproverNoTotal = '/hl/heng/yw/approval/countApproverNoTotal',

  commentList = '/hl/user/comment/commentList',
  addComment = '/hl/user/comment/addComment',

  addYwComment = '/hl/heng/yw/approval/addYwComment',

  ywApprovalDetail = '/hl/heng/yw/approval/ywApprovalDetail',
  ywApprovalDetailByApproveNo = '/hl/heng/yw/approval/ywApprovalDetailByApproveNo',
  ywDeptTotalList = '/hl/heng/yw/approval/ywDeptTotalList',

  getCountDeptTotalLog_biao = '/hl/heng/yw/approval/getCountDeptTotalLog_biao',
  batchSendYwXftQuery= '/hl/heng/yw/approval/batchSendYwXftQuery',
  batchSendYwXftSubmit='/hl/heng/yw/approval/batchSendYwXftSubmit',
  sendYwXftTest='/hl/heng/yw/approval/sendYwXftTest',
  batchSendYwXftBtn='/hl/heng/yw/approval/batchSendYwXftBtn',

  ywZhongBuWaitList = '/hl/heng/yw/approval/ywZhongBuWaitList',
  ywZhongBuSubmit = 'hl/heng/yw/approval/ywZhongBuSubmit',
  ywZhongBuPass = 'hl/heng/yw/approval/ywZhongBuPass',
  ywZhongBuBack = 'hl/heng/yw/approval/ywZhongBuBack',
  ywZhongBuCancel = 'hl/heng/yw/approval/ywZhongBuCancel',

  ywPostageSubmit = 'hl/heng/yw/approval/ywPostageSubmit',
  ywPostagePass = 'hl/heng/yw/approval/ywPostagePass',
  ywPostageBack = 'hl/heng/yw/approval/ywPostageBack',
  ywPostageCancel= 'hl/heng/yw/approval/ywPostageCancel',
  addExcludeData = 'hl/heng/yw/approval/addExcludeData',
  getExcludeDataList = 'hl/heng/yw/approval/getExcludeDataList',
  removeExcludeData = 'hl/heng/yw/approval/removeExcludeData',
  getYwItemList= '/hl/heng/yw/approval/getYwItemList',
}

/**
 * @description: user login api
 */
export function approvalSettingList(params: deptListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.approvalSettingList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function saveApprovalSetting(params: deptListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.saveApprovalSetting,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function approvalSettingDelete(
  params: deptUserListParams,
  mode: ErrorMessageMode = 'modal',
) {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.approvalSettingDelete,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function settingLineList(params: deptUserListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.settingLineList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function saveSettingLine(params: chatidParams, mode: ErrorMessageMode = 'modal') {
  return jsonHttp.post<BasicDataResult>(
    {
      url: Api.saveSettingLine,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function settingLineDelete(params: saveParams, mode: ErrorMessageMode = 'modal') {
  // jsonHttp defHttp
  return defHttp.post<BasicDataResult>(
    {
      url: Api.settingLineDelete,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
export function settingNodeList(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.settingNodeList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function saveSettingNode(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.saveSettingNode,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function settingNodeDelete(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.settingNodeDelete,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function ywApprovalSubmit(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return jsonHttp.post<BasicDataResult>(
    {
      url: Api.ywApprovalSubmit,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

// export function ywApprovalFileSubmit(params: integralListParams, mode: ErrorMessageMode = 'modal') {
//   return defHttp.post<BasicDataResult>(
//     {
//       url: Api.ywApprovalFileSubmit,
//       params,
//     },
//     {
//       errorMessageMode: mode,
//     },
//   );
// }


export function ywApprovalFileSubmit(
  params: any,
  onUploadProgress: (progressEvent: AxiosProgressEvent) => void,
) {
  return defHttp.uploadFile<BasicDataResult>(
    {
      url: Api.ywApprovalFileSubmit,
    },
    params,
  );
}

export function ywApprovalPass(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.ywApprovalPass,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function ywApprovalBack(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.ywApprovalBack,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function ywApprovalCancel(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.ywApprovalCancel,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function ywApprovalCreateView(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.ywApprovalCreateView,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function ywApprovalLogView(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.ywApprovalLogView,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function ywApprovalList(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.ywApprovalList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function ywApprovalShow(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.ywApprovalShow,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function countApproverNoTotal(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.countApproverNoTotal,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
export function commentList(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.commentList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
export function addComment(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.addComment,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function addYwComment(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.addYwComment,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function ywApprovalDetail(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.ywApprovalDetail,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function ywApprovalDetailByApproveNo(
  params: integralListParams,
  mode: ErrorMessageMode = 'modal',
) {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.ywApprovalDetailByApproveNo,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function ywApprovalRemove(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.ywApprovalRemove,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function ywDeptTotalList(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.ywDeptTotalList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function getCountDeptTotalLog_biao(
  params: integralListParams,
  mode: ErrorMessageMode = 'modal',
) {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.getCountDeptTotalLog_biao,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
export function ywZhongBuWaitList(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.ywZhongBuWaitList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function ywZhongBuSubmit(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return jsonHttp.post<BasicDataResult>(
    {
      url: Api.ywZhongBuSubmit,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function ywZhongBuPass(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.ywZhongBuPass,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
export function ywZhongBuBack(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.ywZhongBuBack,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
export function ywZhongBuCancel(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.ywZhongBuCancel,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function ywPostageSubmit(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return jsonHttp.post<BasicDataResult>(
    {
      url: Api.ywPostageSubmit,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function ywPostagePass(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.ywPostagePass,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
export function ywPostageBack(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.ywPostageBack,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
export function ywPostageCancel(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.ywPostageCancel,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

  export function addExcludeData(params: any, mode: ErrorMessageMode = 'modal') {
  return jsonHttp.post<BasicDataResult>(
    {
      url: Api.addExcludeData,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
  
export function getExcludeDataList(params: any, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.getExcludeDataList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function removeExcludeData(params: any, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.removeExcludeData,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function getYwItemList(params: any, mode: ErrorMessageMode = 'modal') {
  return defHttp.get<BasicDataResult>(
    {
      url: Api.getYwItemList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}


export function batchSendYwXftQuery(params: any, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.batchSendYwXftQuery,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}


export function batchSendYwXftSubmit(params: any, mode: ErrorMessageMode = 'modal') {
  return jsonHttp.post<BasicDataResult>(
    {
      url: Api.batchSendYwXftSubmit,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}


export function sendYwXftTest(params: any, mode: ErrorMessageMode = 'modal') {
  return jsonHttp.post<BasicDataResult>(
    {
      url: Api.sendYwXftTest,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function batchSendYwXftBtn(params: any, mode: ErrorMessageMode = 'modal') {
  return  defHttp.post<BasicDataResult>(
    {
      url: Api.batchSendYwXftBtn,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
